﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace ExtendBLL
{
    public class SysSetting
    {
        /// <summary>
        /// 根据学年取得ID，用于更新
        /// </summary>
        /// <param name="Year"></param>
        /// <returns></returns>
        public int GetIDByDDLYear(int Year)
        {
            LabMS.BLL.SysSetting bSys = new LabMS.BLL.SysSetting();
            string str = "CurrentYear="+Year;
            List<LabMS.Model.SysSetting> list = new List<LabMS.Model.SysSetting>();
            list = bSys.GetModelList(str);
            int ID = list[0].ID;
            return ID;
        }


        public LabMS.Model.SysSetting GetCurrentSetting()
        {
            LabMS.BLL.SysSetting bsys = new LabMS.BLL.SysSetting();
            List<LabMS.Model.SysSetting> listsys = new List<LabMS.Model.SysSetting>();
            listsys = bsys.GetModelList("");
            if (listsys.Count == 0)
            {
                throw (new Exception("系统数据需初始化!"));
            }
            return listsys[0];
        }
    }
}
